home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / perlnt.zip / patches < prev    next >
Text File  |  1993-07-25  |  56KB  |  2,208 lines

  1. *** ../src-4.036/cmd.c    Tue Apr  6 15:42:20 1993
  2. --- cmd.c    Fri May 21 09:17:52 1993
  3. ***************
  4. *** 38,43 ****
  5. --- 41,49 ----
  6.   #  include <varargs.h>
  7.   #endif
  8.   
  9. + #ifdef I_STDARG
  10. + #  include <stdarg.h>
  11. + #endif
  12.   static STR strchop;
  13.   
  14.   void grow_dlevel();
  15. *** ../src-4.036/config.h    Tue Apr  6 15:42:14 1993
  16. --- config.h    Fri May 21 10:22:57 1993
  17. ***************
  18. *** 1,17 ****
  19.   #ifndef config_h
  20.   #define config_h
  21. - /* config.h
  22. -  * This file was produced by running the config.h.SH script, which
  23. -  * gets its values from config.sh, which is generally produced by
  24. -  * running Configure.
  25. -  *
  26. -  * Feel free to modify any of this as the need arises.  Note, however,
  27. -  * that running config.h.SH again will wipe out any changes you've made.
  28. -  * For a more permanent change edit config.sh and rerun config.h.SH.
  29. -  */
  30. -  /*SUPPRESS 460*/
  31.   
  32.   /* EUNICE
  33.    *    This symbol, if defined, indicates that the program is being compiled
  34.    *    under the EUNICE package under VMS.  The program will need to handle
  35. --- 1,8 ----
  36. + /* This is the config.h for the Windows NT port of Perl */
  37.   #ifndef config_h
  38.   #define config_h
  39.   
  40.   /* EUNICE
  41.    *    This symbol, if defined, indicates that the program is being compiled
  42.    *    under the EUNICE package under VMS.  The program will need to handle
  43. ***************
  44. *** 42,48 ****
  45.    *    to keep publicly executable images for the package in question.  It
  46.    *    is most often a local directory such as /usr/local/bin.
  47.    */
  48. ! #define BIN "/usr/local/bin"             /**/
  49.   
  50.   /* BYTEORDER
  51.    *    This symbol contains an encoding of the order of bytes in a long.
  52. --- 33,40 ----
  53.    *    to keep publicly executable images for the package in question.  It
  54.    *    is most often a local directory such as /usr/local/bin.
  55.    */
  56. ! #define BIN (char *)NtGetBin()
  57. ! #define DEFBIN "c:\\win32app\\ingr\\perl\\bin"
  58.   
  59.   /* BYTEORDER
  60.    *    This symbol contains an encoding of the order of bytes in a long.
  61. ***************
  62. *** 61,67 ****
  63.    *    output.  This symbol will have the value "-" if CPPSTDIN needs a minus
  64.    *    to specify standard input, otherwise the value is "".
  65.    */
  66. ! #define CPPSTDIN "cppstdin"
  67.   #define CPPMINUS ""
  68.   
  69.   /* HAS_BCMP
  70. --- 53,59 ----
  71.    *    output.  This symbol will have the value "-" if CPPSTDIN needs a minus
  72.    *    to specify standard input, otherwise the value is "".
  73.    */
  74. ! #define CPPSTDIN "cpp"
  75.   #define CPPMINUS ""
  76.   
  77.   /* HAS_BCMP
  78. ***************
  79. *** 69,75 ****
  80.    *    to compare blocks of memory.  If undefined, use memcmp.  If that's
  81.    *    not available, roll your own.
  82.    */
  83. ! #define    HAS_BCMP        /**/
  84.   
  85.   /* HAS_BCOPY
  86.    *    This symbol, if defined, indicates that the bcopy routine is available
  87. --- 61,67 ----
  88.    *    to compare blocks of memory.  If undefined, use memcmp.  If that's
  89.    *    not available, roll your own.
  90.    */
  91. ! /*#undef    HAS_BCMP        /**/
  92.   
  93.   /* HAS_BCOPY
  94.    *    This symbol, if defined, indicates that the bcopy routine is available
  95. ***************
  96. *** 82,96 ****
  97.    *    should probably use memmove() or memcpy().  If neither is defined,
  98.    *    roll your own.
  99.    */
  100. ! #define    HAS_BCOPY        /**/
  101. ! #define    SAFE_BCOPY        /**/
  102.   
  103.   /* HAS_BZERO
  104.    *    This symbol, if defined, indicates that the bzero routine is available
  105.    *    to zero blocks of memory.  Otherwise you should probably use memset()
  106.    *    or roll your own.
  107.    */
  108. ! #define    HAS_BZERO        /**/
  109.   
  110.   /* CASTNEGFLOAT
  111.    *    This symbol, if defined, indicates that this C compiler knows how to
  112. --- 74,88 ----
  113.    *    should probably use memmove() or memcpy().  If neither is defined,
  114.    *    roll your own.
  115.    */
  116. ! /*#undef    HAS_BCOPY        /**/
  117. ! /*#undef    SAFE_BCOPY        /**/
  118.   
  119.   /* HAS_BZERO
  120.    *    This symbol, if defined, indicates that the bzero routine is available
  121.    *    to zero blocks of memory.  Otherwise you should probably use memset()
  122.    *    or roll your own.
  123.    */
  124. ! /*#undef    HAS_BZERO        /**/
  125.   
  126.   /* CASTNEGFLOAT
  127.    *    This symbol, if defined, indicates that this C compiler knows how to
  128. ***************
  129. *** 118,136 ****
  130.    *    This symbol, if defined, indicates that the chsize routine is available
  131.    *    to truncate files.  You might need a -lx to get this routine.
  132.    */
  133. ! /*#undef    HAS_CHSIZE        /**/
  134.   
  135.   /* HAS_CRYPT
  136.    *    This symbol, if defined, indicates that the crypt routine is available
  137.    *    to encrypt passwords and the like.
  138.    */
  139. ! #define    HAS_CRYPT        /**/
  140.   
  141.   /* CSH
  142.    *    This symbol, if defined, indicates that the C-shell exists.
  143.    *    If defined, contains the full pathname of csh.
  144.    */
  145. ! #define CSH "/bin/csh"        /**/
  146.   
  147.   /* DOSUID
  148.    *    This symbol, if defined, indicates that the C program should
  149. --- 110,128 ----
  150.    *    This symbol, if defined, indicates that the chsize routine is available
  151.    *    to truncate files.  You might need a -lx to get this routine.
  152.    */
  153. ! #define    HAS_CHSIZE        /**/
  154.   
  155.   /* HAS_CRYPT
  156.    *    This symbol, if defined, indicates that the crypt routine is available
  157.    *    to encrypt passwords and the like.
  158.    */
  159. ! /*#undef    HAS_CRYPT        /**/
  160.   
  161.   /* CSH
  162.    *    This symbol, if defined, indicates that the C-shell exists.
  163.    *    If defined, contains the full pathname of csh.
  164.    */
  165. ! /*#undef CSH "/bin/csh"        /**/
  166.   
  167.   /* DOSUID
  168.    *    This symbol, if defined, indicates that the C program should
  169. ***************
  170. *** 169,175 ****
  171.    *    This symbol, if defined, indicates to the C program that
  172.    *    the fcntl() function exists.
  173.    */
  174. ! #define    HAS_FCNTL        /**/
  175.   
  176.   /* FLEXFILENAMES
  177.    *    This symbol, if defined, indicates that the system supports filenames
  178. --- 161,167 ----
  179.    *    This symbol, if defined, indicates to the C program that
  180.    *    the fcntl() function exists.
  181.    */
  182. ! /*#undef    HAS_FCNTL        /**/
  183.   
  184.   /* FLEXFILENAMES
  185.    *    This symbol, if defined, indicates that the system supports filenames
  186. ***************
  187. *** 188,212 ****
  188.    *    available to get the list of process groups.  If unavailable, multiple
  189.    *    groups are probably not supported.
  190.    */
  191. ! #define    HAS_GETGROUPS        /**/
  192.   
  193.   /* HAS_GETHOSTENT
  194.    *    This symbol, if defined, indicates that the gethostent() routine is
  195.    *    available to lookup host names in some data base or other.
  196.    */
  197. ! #define    HAS_GETHOSTENT        /**/
  198.   
  199.   /* HAS_GETPGRP
  200.    *    This symbol, if defined, indicates that the getpgrp() routine is
  201.    *    available to get the current process group.
  202.    */
  203. ! #define    HAS_GETPGRP        /**/
  204.   
  205.   /* HAS_GETPGRP2
  206.    *    This symbol, if defined, indicates that the getpgrp2() (as in DG/UX)
  207.    *    routine is available to get the current process group.
  208.    */
  209. ! #define    HAS_GETPGRP2        /**/
  210.   
  211.   /* HAS_GETPRIORITY
  212.    *    This symbol, if defined, indicates that the getpriority() routine is
  213. --- 180,204 ----
  214.    *    available to get the list of process groups.  If unavailable, multiple
  215.    *    groups are probably not supported.
  216.    */
  217. ! /*#undef    HAS_GETGROUPS        /**/
  218.   
  219.   /* HAS_GETHOSTENT
  220.    *    This symbol, if defined, indicates that the gethostent() routine is
  221.    *    available to lookup host names in some data base or other.
  222.    */
  223. ! /*#undef    HAS_GETHOSTENT        /**/
  224.   
  225.   /* HAS_GETPGRP
  226.    *    This symbol, if defined, indicates that the getpgrp() routine is
  227.    *    available to get the current process group.
  228.    */
  229. ! /*#undef    HAS_GETPGRP        /**/
  230.   
  231.   /* HAS_GETPGRP2
  232.    *    This symbol, if defined, indicates that the getpgrp2() (as in DG/UX)
  233.    *    routine is available to get the current process group.
  234.    */
  235. ! /*#undef    HAS_GETPGRP2        /**/
  236.   
  237.   /* HAS_GETPRIORITY
  238.    *    This symbol, if defined, indicates that the getpriority() routine is
  239. ***************
  240. *** 257,269 ****
  241.    *    to kill process groups.  If unavailable, you probably should use kill
  242.    *    with a negative process number.
  243.    */
  244. ! #define    HAS_KILLPG        /**/
  245.   
  246.   /* HAS_LSTAT
  247.    *    This symbol, if defined, indicates that the lstat() routine is
  248.    *    available to stat symbolic links.
  249.    */
  250. ! #define    HAS_LSTAT        /**/
  251.   
  252.   /* HAS_MEMCMP
  253.    *    This symbol, if defined, indicates that the memcmp routine is available
  254. --- 249,261 ----
  255.    *    to kill process groups.  If unavailable, you probably should use kill
  256.    *    with a negative process number.
  257.    */
  258. ! /*#undef    HAS_KILLPG        /**/
  259.   
  260.   /* HAS_LSTAT
  261.    *    This symbol, if defined, indicates that the lstat() routine is
  262.    *    available to stat symbolic links.
  263.    */
  264. ! /*#undef    HAS_LSTAT        /**/
  265.   
  266.   /* HAS_MEMCMP
  267.    *    This symbol, if defined, indicates that the memcmp routine is available
  268. ***************
  269. *** 309,345 ****
  270.    *    This symbol, if defined, indicates that the entire msg*(2) library is
  271.    *    supported.
  272.    */
  273. ! #define    HAS_MSG        /**/
  274.   
  275.   /* HAS_MSGCTL
  276.    *    This symbol, if defined, indicates that the msgctl() routine is
  277.    *    available to control message passing.
  278.    */
  279. ! #define    HAS_MSGCTL        /**/
  280.   
  281.   /* HAS_MSGGET
  282.    *    This symbol, if defined, indicates that the msgget() routine is
  283.    *    available to get messages.
  284.    */
  285. ! #define    HAS_MSGGET        /**/
  286.   
  287.   /* HAS_MSGRCV
  288.    *    This symbol, if defined, indicates that the msgrcv() routine is
  289.    *    available to receive messages.
  290.    */
  291. ! #define    HAS_MSGRCV        /**/
  292.   
  293.   /* HAS_MSGSND
  294.    *    This symbol, if defined, indicates that the msgsnd() routine is
  295.    *    available to send messages.
  296.    */
  297. ! #define    HAS_MSGSND        /**/
  298.   
  299.   /* HAS_NDBM
  300.    *    This symbol, if defined, indicates that ndbm.h exists and should
  301.    *    be included.
  302.    */
  303. ! #define    HAS_NDBM        /**/
  304.   
  305.   /* HAS_ODBM
  306.    *    This symbol, if defined, indicates that dbm.h exists and should
  307. --- 301,337 ----
  308.    *    This symbol, if defined, indicates that the entire msg*(2) library is
  309.    *    supported.
  310.    */
  311. ! /*#undef    HAS_MSG        /**/
  312.   
  313.   /* HAS_MSGCTL
  314.    *    This symbol, if defined, indicates that the msgctl() routine is
  315.    *    available to control message passing.
  316.    */
  317. ! /*#undef    HAS_MSGCTL        /**/
  318.   
  319.   /* HAS_MSGGET
  320.    *    This symbol, if defined, indicates that the msgget() routine is
  321.    *    available to get messages.
  322.    */
  323. ! /*#undef    HAS_MSGGET        /**/
  324.   
  325.   /* HAS_MSGRCV
  326.    *    This symbol, if defined, indicates that the msgrcv() routine is
  327.    *    available to receive messages.
  328.    */
  329. ! /*#undef    HAS_MSGRCV        /**/
  330.   
  331.   /* HAS_MSGSND
  332.    *    This symbol, if defined, indicates that the msgsnd() routine is
  333.    *    available to send messages.
  334.    */
  335. ! /*#undef    HAS_MSGSND        /**/
  336.   
  337.   /* HAS_NDBM
  338.    *    This symbol, if defined, indicates that ndbm.h exists and should
  339.    *    be included.
  340.    */
  341. ! /*#undef    HAS_NDBM        /**/
  342.   
  343.   /* HAS_ODBM
  344.    *    This symbol, if defined, indicates that dbm.h exists and should
  345. ***************
  346. *** 351,357 ****
  347.    *    This manifest constant lets the C program know that the three
  348.    *    argument form of open(2) is available.
  349.    */
  350. ! #define    HAS_OPEN3        /**/
  351.   
  352.   /* HAS_READDIR
  353.    *    This symbol, if defined, indicates that the readdir routine is available
  354. --- 343,349 ----
  355.    *    This manifest constant lets the C program know that the three
  356.    *    argument form of open(2) is available.
  357.    */
  358. ! /*#undef    HAS_OPEN3        /**/
  359.   
  360.   /* HAS_READDIR
  361.    *    This symbol, if defined, indicates that the readdir routine is available
  362. ***************
  363. *** 389,419 ****
  364.    *    This symbol, if defined, indicates that the select() subroutine
  365.    *    exists.
  366.    */
  367. ! #define    HAS_SELECT    /**/
  368.   
  369.   /* HAS_SEM
  370.    *    This symbol, if defined, indicates that the entire sem*(2) library is
  371.    *    supported.
  372.    */
  373. ! #define    HAS_SEM        /**/
  374.   
  375.   /* HAS_SEMCTL
  376.    *    This symbol, if defined, indicates that the semctl() routine is
  377.    *    available to control semaphores.
  378.    */
  379. ! #define    HAS_SEMCTL        /**/
  380.   
  381.   /* HAS_SEMGET
  382.    *    This symbol, if defined, indicates that the semget() routine is
  383.    *    available to get semaphores ids.
  384.    */
  385. ! #define    HAS_SEMGET        /**/
  386.   
  387.   /* HAS_SEMOP
  388.    *    This symbol, if defined, indicates that the semop() routine is
  389.    *    available to perform semaphore operations.
  390.    */
  391. ! #define    HAS_SEMOP        /**/
  392.   
  393.   /* HAS_SETEGID
  394.    *    This symbol, if defined, indicates that the setegid routine is available
  395. --- 381,411 ----
  396.    *    This symbol, if defined, indicates that the select() subroutine
  397.    *    exists.
  398.    */
  399. ! /*#undef    HAS_SELECT    /**/
  400.   
  401.   /* HAS_SEM
  402.    *    This symbol, if defined, indicates that the entire sem*(2) library is
  403.    *    supported.
  404.    */
  405. ! /*#undef    HAS_SEM        /**/
  406.   
  407.   /* HAS_SEMCTL
  408.    *    This symbol, if defined, indicates that the semctl() routine is
  409.    *    available to control semaphores.
  410.    */
  411. ! /*#undef    HAS_SEMCTL        /**/
  412.   
  413.   /* HAS_SEMGET
  414.    *    This symbol, if defined, indicates that the semget() routine is
  415.    *    available to get semaphores ids.
  416.    */
  417. ! /*#undef    HAS_SEMGET        /**/
  418.   
  419.   /* HAS_SEMOP
  420.    *    This symbol, if defined, indicates that the semop() routine is
  421.    *    available to perform semaphore operations.
  422.    */
  423. ! /*#undef    HAS_SEMOP        /**/
  424.   
  425.   /* HAS_SETEGID
  426.    *    This symbol, if defined, indicates that the setegid routine is available
  427. ***************
  428. *** 431,443 ****
  429.    *    This symbol, if defined, indicates that the setpgrp() routine is
  430.    *    available to set the current process group.
  431.    */
  432. ! #define    HAS_SETPGRP        /**/
  433.   
  434.   /* HAS_SETPGRP2
  435.    *    This symbol, if defined, indicates that the setpgrp2() (as in DG/UX)
  436.    *    routine is available to set the current process group.
  437.    */
  438. ! #define    HAS_SETPGRP2        /**/
  439.   
  440.   /* HAS_SETPRIORITY
  441.    *    This symbol, if defined, indicates that the setpriority() routine is
  442. --- 423,435 ----
  443.    *    This symbol, if defined, indicates that the setpgrp() routine is
  444.    *    available to set the current process group.
  445.    */
  446. ! /*#undef    HAS_SETPGRP        /**/
  447.   
  448.   /* HAS_SETPGRP2
  449.    *    This symbol, if defined, indicates that the setpgrp2() (as in DG/UX)
  450.    *    routine is available to set the current process group.
  451.    */
  452. ! /*#undef    HAS_SETPGRP2        /**/
  453.   
  454.   /* HAS_SETPRIORITY
  455.    *    This symbol, if defined, indicates that the setpriority() routine is
  456. ***************
  457. *** 485,491 ****
  458.    *    This symbol, if defined, indicates that the entire shm*(2) library is
  459.    *    supported.
  460.    */
  461. ! #define    HAS_SHM        /**/
  462.   
  463.   /* HAS_SHMAT
  464.    *    This symbol, if defined, indicates that the shmat() routine is
  465. --- 477,483 ----
  466.    *    This symbol, if defined, indicates that the entire shm*(2) library is
  467.    *    supported.
  468.    */
  469. ! /*#undef    HAS_SHM        /**/
  470.   
  471.   /* HAS_SHMAT
  472.    *    This symbol, if defined, indicates that the shmat() routine is
  473. ***************
  474. *** 495,501 ****
  475.    *    This symbol, if defined, indicates that the shmat() routine
  476.    *    returns a pointer of type void*.
  477.    */
  478. ! #define    HAS_SHMAT        /**/
  479.   
  480.   /*#undef    VOIDSHMAT        /**/
  481.   
  482. --- 487,493 ----
  483.    *    This symbol, if defined, indicates that the shmat() routine
  484.    *    returns a pointer of type void*.
  485.    */
  486. ! /*#undef    HAS_SHMAT        /**/
  487.   
  488.   /*#undef    VOIDSHMAT        /**/
  489.   
  490. ***************
  491. *** 503,521 ****
  492.    *    This symbol, if defined, indicates that the shmctl() routine is
  493.    *    available to control a shared memory segment.
  494.    */
  495. ! #define    HAS_SHMCTL        /**/
  496.   
  497.   /* HAS_SHMDT
  498.    *    This symbol, if defined, indicates that the shmdt() routine is
  499.    *    available to detach a shared memory segment.
  500.    */
  501. ! #define    HAS_SHMDT        /**/
  502.   
  503.   /* HAS_SHMGET
  504.    *    This symbol, if defined, indicates that the shmget() routine is
  505.    *    available to get a shared memory segment id.
  506.    */
  507. ! #define    HAS_SHMGET        /**/
  508.   
  509.   /* HAS_SOCKET
  510.    *    This symbol, if defined, indicates that the BSD socket interface is
  511. --- 495,513 ----
  512.    *    This symbol, if defined, indicates that the shmctl() routine is
  513.    *    available to control a shared memory segment.
  514.    */
  515. ! /*#undef    HAS_SHMCTL        /**/
  516.   
  517.   /* HAS_SHMDT
  518.    *    This symbol, if defined, indicates that the shmdt() routine is
  519.    *    available to detach a shared memory segment.
  520.    */
  521. ! /*#undef    HAS_SHMDT        /**/
  522.   
  523.   /* HAS_SHMGET
  524.    *    This symbol, if defined, indicates that the shmget() routine is
  525.    *    available to get a shared memory segment id.
  526.    */
  527. ! /*#undef    HAS_SHMGET        /**/
  528.   
  529.   /* HAS_SOCKET
  530.    *    This symbol, if defined, indicates that the BSD socket interface is
  531. ***************
  532. *** 531,537 ****
  533.    */
  534.   #define    HAS_SOCKET        /**/
  535.   
  536. ! #define    HAS_SOCKETPAIR    /**/
  537.   
  538.   /*#undef    OLDSOCKET    /**/
  539.   
  540. --- 523,529 ----
  541.    */
  542.   #define    HAS_SOCKET        /**/
  543.   
  544. ! /*#undef    HAS_SOCKETPAIR    /**/
  545.   
  546.   /*#undef    OLDSOCKET    /**/
  547.   
  548. ***************
  549. *** 564,576 ****
  550.    *    This symbol, if defined, indicates that the symlink routine is available
  551.    *    to create symbolic links.
  552.    */
  553. ! #define    HAS_SYMLINK        /**/
  554.   
  555.   /* HAS_SYSCALL
  556.    *    This symbol, if defined, indicates that the syscall routine is available
  557.    *    to call arbitrary system calls.  If undefined, that's tough.
  558.    */
  559. ! #define    HAS_SYSCALL        /**/
  560.   
  561.   /* HAS_TELLDIR
  562.    *    This symbol, if defined, indicates that the telldir routine is
  563. --- 556,568 ----
  564.    *    This symbol, if defined, indicates that the symlink routine is available
  565.    *    to create symbolic links.
  566.    */
  567. ! /*#undef    HAS_SYMLINK        /**/
  568.   
  569.   /* HAS_SYSCALL
  570.    *    This symbol, if defined, indicates that the syscall routine is available
  571.    *    to call arbitrary system calls.  If undefined, that's tough.
  572.    */
  573. ! /*#undef    HAS_SYSCALL        /**/
  574.   
  575.   /* HAS_TELLDIR
  576.    *    This symbol, if defined, indicates that the telldir routine is
  577. ***************
  578. *** 587,593 ****
  579.   /* HAS_VFORK
  580.    *    This symbol, if defined, indicates that vfork() exists.
  581.    */
  582. ! #define    HAS_VFORK    /**/
  583.   
  584.   /* VOIDSIG
  585.    *    This symbol is defined if this system declares "void (*signal())()" in
  586. --- 579,585 ----
  587.   /* HAS_VFORK
  588.    *    This symbol, if defined, indicates that vfork() exists.
  589.    */
  590. ! /*#undef    HAS_VFORK    /**/
  591.   
  592.   /* VOIDSIG
  593.    *    This symbol is defined if this system declares "void (*signal())()" in
  594. ***************
  595. *** 602,608 ****
  596.    *    handler using "TO_SIGNAL handler(sig)".
  597.    */
  598.   #define    VOIDSIG     /**/
  599. ! #define    TO_SIGNAL    int     /**/
  600.   
  601.   /* HASVOLATILE
  602.    *    This symbol, if defined, indicates that this C compiler knows about
  603. --- 594,600 ----
  604.    *    handler using "TO_SIGNAL handler(sig)".
  605.    */
  606.   #define    VOIDSIG     /**/
  607. ! #define    TO_SIGNAL    void     /**/
  608.   
  609.   /* HASVOLATILE
  610.    *    This symbol, if defined, indicates that this C compiler knows about
  611. ***************
  612. *** 632,650 ****
  613.   /* HAS_WAITPID
  614.    *    This symbol, if defined, indicates that waitpid() exists.
  615.    */
  616. ! #define    HAS_WAITPID    /**/
  617.   
  618.   /* GIDTYPE
  619.    *    This symbol has a value like gid_t, int, ushort, or whatever type is
  620.    *    used to declare group ids in the kernel.
  621.    */
  622. ! #define GIDTYPE gid_t        /**/
  623.   
  624.   /* GROUPSTYPE
  625.    *    This symbol has a value like gid_t, int, ushort, or whatever type is
  626.    *    used in the return value of getgroups().
  627.    */
  628. ! #define GROUPSTYPE gid_t        /**/
  629.   
  630.   /* I_FCNTL
  631.    *    This manifest constant tells the C program to include <fcntl.h>.
  632. --- 624,642 ----
  633.   /* HAS_WAITPID
  634.    *    This symbol, if defined, indicates that waitpid() exists.
  635.    */
  636. ! /*#undef    HAS_WAITPID    /**/
  637.   
  638.   /* GIDTYPE
  639.    *    This symbol has a value like gid_t, int, ushort, or whatever type is
  640.    *    used to declare group ids in the kernel.
  641.    */
  642. ! #define GIDTYPE unsigned short
  643.   
  644.   /* GROUPSTYPE
  645.    *    This symbol has a value like gid_t, int, ushort, or whatever type is
  646.    *    used in the return value of getgroups().
  647.    */
  648. ! /*#undef GROUPSTYPE gid_t        /**/
  649.   
  650.   /* I_FCNTL
  651.    *    This manifest constant tells the C program to include <fcntl.h>.
  652. ***************
  653. *** 661,667 ****
  654.    *    This symbol, if defined, indicates to the C program that it should
  655.    *    include grp.h.
  656.    */
  657. ! #define    I_GRP        /**/
  658.   
  659.   /* I_NETINET_IN
  660.    *    This symbol, if defined, indicates to the C program that it should
  661. --- 653,659 ----
  662.    *    This symbol, if defined, indicates to the C program that it should
  663.    *    include grp.h.
  664.    */
  665. ! /*#undef    I_GRP        /**/
  666.   
  667.   /* I_NETINET_IN
  668.    *    This symbol, if defined, indicates to the C program that it should
  669. ***************
  670. *** 671,677 ****
  671.    *    This symbol, if defined, indicates to the C program that it should
  672.    *    include sys/in.h.
  673.    */
  674. ! #define    I_NETINET_IN        /**/
  675.   /*#undef    I_SYS_IN        /**/
  676.   
  677.   /* I_PWD
  678. --- 663,669 ----
  679.    *    This symbol, if defined, indicates to the C program that it should
  680.    *    include sys/in.h.
  681.    */
  682. ! /*#undef    I_NETINET_IN        /**/
  683.   /*#undef    I_SYS_IN        /**/
  684.   
  685.   /* I_PWD
  686. ***************
  687. *** 702,714 ****
  688.    *    This symbol, if defined, indicates to the C program that struct passwd
  689.    *    contains pw_comment.
  690.    */
  691. ! #define    I_PWD        /**/
  692.   /*#undef    PWQUOTA        /**/
  693. ! #define    PWAGE        /**/
  694.   /*#undef    PWCHANGE    /**/
  695.   /*#undef    PWCLASS        /**/
  696.   /*#undef    PWEXPIRE    /**/
  697. ! #define    PWCOMMENT    /**/
  698.   
  699.   /* I_SYS_FILE
  700.    *    This manifest constant tells the C program to include <sys/file.h>.
  701. --- 694,706 ----
  702.    *    This symbol, if defined, indicates to the C program that struct passwd
  703.    *    contains pw_comment.
  704.    */
  705. ! /*#undef    I_PWD        /**/
  706.   /*#undef    PWQUOTA        /**/
  707. ! /*#undef    PWAGE        /**/
  708.   /*#undef    PWCHANGE    /**/
  709.   /*#undef    PWCLASS        /**/
  710.   /*#undef    PWEXPIRE    /**/
  711. ! /*#undef    PWCOMMENT    /**/
  712.   
  713.   /* I_SYS_FILE
  714.    *    This manifest constant tells the C program to include <sys/file.h>.
  715. ***************
  716. *** 719,725 ****
  717.    *    This symbol, if defined, indicates that sys/ioctl.h exists and should
  718.    *    be included.
  719.    */
  720. ! #define    I_SYSIOCTL        /**/
  721.   
  722.   /* I_TIME
  723.    *    This symbol is defined if the program should include <time.h>.
  724. --- 711,717 ----
  725.    *    This symbol, if defined, indicates that sys/ioctl.h exists and should
  726.    *    be included.
  727.    */
  728. ! /*#undef    I_SYSIOCTL        /**/
  729.   
  730.   /* I_TIME
  731.    *    This symbol is defined if the program should include <time.h>.
  732. ***************
  733. *** 734,741 ****
  734.   /* I_SYS_SELECT
  735.    *    This symbol is defined if the program should include <sys/select.h>.
  736.    */
  737. ! /*#undef    I_TIME         /**/
  738. ! #define    I_SYS_TIME     /**/
  739.   /*#undef    SYSTIMEKERNEL     /**/
  740.   /*#undef    I_SYS_SELECT     /**/
  741.   
  742. --- 726,733 ----
  743.   /* I_SYS_SELECT
  744.    *    This symbol is defined if the program should include <sys/select.h>.
  745.    */
  746. ! #define    I_TIME         /**/
  747. ! /*#undef    I_SYS_TIME     /**/
  748.   /*#undef    SYSTIMEKERNEL     /**/
  749.   /*#undef    I_SYS_SELECT     /**/
  750.   
  751. ***************
  752. *** 749,755 ****
  753.    *    This symbol, if defined, indicates to the C program that it should
  754.    *    include varargs.h.
  755.    */
  756. ! #define    I_VARARGS        /**/
  757.   
  758.   /* I_VFORK
  759.    *    This symbol, if defined, indicates to the C program that it should
  760. --- 741,749 ----
  761.    *    This symbol, if defined, indicates to the C program that it should
  762.    *    include varargs.h.
  763.    */
  764. ! /*#undef    I_VARARGS        /**/
  765. ! #define I_STDARG
  766.   
  767.   /* I_VFORK
  768.    *    This symbol, if defined, indicates to the C program that it should
  769. ***************
  770. *** 788,799 ****
  771.    *    of directory entry names is provided by a d_namlen field.  Otherwise
  772.    *    you need to do strlen() on the d_name field.
  773.    */
  774. ! #define    I_DIRENT    /**/
  775.   /*#undef    I_SYS_DIR    /**/
  776.   /*#undef    I_NDIR        /**/
  777.   /*#undef    I_SYS_NDIR    /**/
  778.   /*#undef    I_MY_DIR    /**/
  779. ! /*#undef    DIRNAMLEN    /**/
  780.   
  781.   /* MYMALLOC
  782.    *    This symbol, if defined, indicates that we're using our own malloc.
  783. --- 782,794 ----
  784.    *    of directory entry names is provided by a d_namlen field.  Otherwise
  785.    *    you need to do strlen() on the d_name field.
  786.    */
  787. ! /*#undef    I_DIRENT    /**/
  788.   /*#undef    I_SYS_DIR    /**/
  789.   /*#undef    I_NDIR        /**/
  790.   /*#undef    I_SYS_NDIR    /**/
  791.   /*#undef    I_MY_DIR    /**/
  792. ! #define    DIRNAMLEN    /**/
  793.   
  794.   /* MYMALLOC
  795.    *    This symbol, if defined, indicates that we're using our own malloc.
  796. ***************
  797. *** 817,840 ****
  798.    *    to keep publicly executable scripts for the package in question.  It
  799.    *    is often a directory that is mounted across diverse architectures.
  800.    */
  801. ! #define SCRIPTDIR "/usr/local/bin"             /**/
  802.   
  803.   /* SIG_NAME
  804.    *    This symbol contains an list of signal names in order.
  805.    */
  806. ! #define SIG_NAME "ZERO","HUP","INT","QUIT","ILL","TRAP","ABRT","EMT","FPE","KILL","BUS","SEGV","SYS","PIPE","ALRM","TERM","USR1","USR2","CHLD","PWR","URG","IO","POLL","STOP","TSTP","TTIN","TTOU","CONT","VTALRM","PROF"        /**/
  807.   
  808.   /* STDCHAR
  809.    *    This symbol is defined to be the type of char used in stdio.h.
  810.    *    It has the values "unsigned char" or "char".
  811.    */
  812. ! #define STDCHAR unsigned char    /**/
  813.   
  814.   /* UIDTYPE
  815.    *    This symbol has a value like uid_t, int, ushort, or whatever type is
  816.    *    used to declare user ids in the kernel.
  817.    */
  818. ! #define UIDTYPE uid_t        /**/
  819.   
  820.   /* VOIDHAVE
  821.    *    This symbol indicates how much support of the void type is given by this
  822. --- 812,837 ----
  823.    *    to keep publicly executable scripts for the package in question.  It
  824.    *    is often a directory that is mounted across diverse architectures.
  825.    */
  826. ! #define SCRIPTDIR (char *)NtGetBin()
  827. ! #define DEFSCRIPT "C:\\win32app\\ingr\\perl\\bin"             /**/
  828.   
  829.   /* SIG_NAME
  830.    *    This symbol contains an list of signal names in order.
  831.    */
  832. ! #define SIG_NAME "0","1","INT","3","ILL","5","6","7","FPE","9","10","SEGV",\
  833. !                  "12","13","14","TERM","16","17","18","19","20","BREAK","ABRT"
  834.   
  835.   /* STDCHAR
  836.    *    This symbol is defined to be the type of char used in stdio.h.
  837.    *    It has the values "unsigned char" or "char".
  838.    */
  839. ! #define STDCHAR char    /**/
  840.   
  841.   /* UIDTYPE
  842.    *    This symbol has a value like uid_t, int, ushort, or whatever type is
  843.    *    used to declare user ids in the kernel.
  844.    */
  845. ! #define UIDTYPE unsigned short
  846.   
  847.   /* VOIDHAVE
  848.    *    This symbol indicates how much support of the void type is given by this
  849. ***************
  850. *** 861,885 ****
  851.    *    appropriately.  Otherwise, its value is the empty string.  The primary
  852.    *    use of this symbol is in specifying void parameter lists for function
  853.    *    prototypes.
  854.    */
  855.   /* VOIDP
  856.    *    This symbol is used for casting generic pointers.  On implementations
  857.    *    which support void appropriately, its value is "void *".  Otherwise,
  858.    *    its value is "char *".
  859.    */
  860. - #ifndef VOIDWANT
  861. - #define VOIDWANT 7
  862. - #endif
  863. - #define VOIDHAVE 7
  864. - #if (VOIDHAVE & VOIDWANT) != VOIDWANT
  865. - #define void int        /* is void to be avoided? */
  866. - #define VOID
  867. - #define VOIDP (char *)
  868. - #define M_VOID        /* Xenix strikes again */
  869. - #else
  870. - #define VOID void
  871.   #define VOIDP (void *)
  872. - #endif
  873.   
  874.   /* PRIVLIB
  875.    *    This symbol contains the name of the private library for this package.
  876. --- 858,872 ----
  877.    *    appropriately.  Otherwise, its value is the empty string.  The primary
  878.    *    use of this symbol is in specifying void parameter lists for function
  879.    *    prototypes.
  880. +  *   N.B. Don't define this for NT, since they use VOID as a conditional
  881. +  *        to define other types.
  882.    */
  883.   /* VOIDP
  884.    *    This symbol is used for casting generic pointers.  On implementations
  885.    *    which support void appropriately, its value is "void *".  Otherwise,
  886.    *    its value is "char *".
  887.    */
  888.   #define VOIDP (void *)
  889.   
  890.   /* PRIVLIB
  891.    *    This symbol contains the name of the private library for this package.
  892. ***************
  893. *** 887,892 ****
  894.    *    execution path, but it should be accessible by the world.  The program
  895.    *    should be prepared to do ~ expansion.
  896.    */
  897. ! #define PRIVLIB "/usr/local/lib/perl"        /**/
  898.   
  899.   #endif
  900. --- 874,885 ----
  901.    *    execution path, but it should be accessible by the world.  The program
  902.    *    should be prepared to do ~ expansion.
  903.    */
  904. ! #define DEFPRIVLIB "C:\\win32app\\ingr\\perl\\lib"
  905. ! #define PRIVLIB (char *) NtGetLib()
  906. ! #define HAS_GETLOGIN
  907.   
  908. + #include "nt.h"
  909.   #endif
  910. *** ../src-4.036/cons.c    Tue Apr  6 15:42:06 1993
  911. --- cons.c    Fri May 21 09:17:57 1993
  912. ***************
  913. *** 969,974 ****
  914. --- 972,980 ----
  915.       if (++error_count >= 10)
  916.       fatal("%s has too many errors.\n",
  917.       stab_val(curcmd->c_filestab)->str_ptr);
  918. + #if defined(NT)
  919. +     return 0;
  920. + #endif
  921.   }
  922.   
  923.   void
  924. *** ../src-4.036/doio.c    Tue Apr  6 15:42:04 1993
  925. --- doio.c    Fri May 21 09:18:52 1993
  926. ***************
  927. *** 52,62 ****
  928. --- 55,69 ----
  929.   #include "perl.h"
  930.   
  931.   #ifdef HAS_SOCKET
  932. + #if !defined(NT)
  933.   #include <sys/socket.h>
  934.   #include <netdb.h>
  935.   #ifndef ENOTSOCK
  936.   #include <net/errno.h>
  937.   #endif
  938. + #else
  939. + #define ENOTSOCK WSAENOTSOCK
  940. + #endif
  941.   #endif
  942.   
  943.   #ifdef HAS_SELECT
  944. ***************
  945. *** 68,75 ****
  946. --- 75,84 ----
  947.   #endif
  948.   
  949.   #ifdef HOST_NOT_FOUND
  950. + #if !defined(NT)
  951.   extern int h_errno;
  952.   #endif
  953. + #endif
  954.   
  955.   #if defined(HAS_MSG) || defined(HAS_SEM) || defined(HAS_SHM)
  956.   #include <sys/ipc.h>
  957. ***************
  958. *** 91,98 ****
  959. --- 100,111 ----
  960.   #include <grp.h>
  961.   #endif
  962.   #ifdef I_UTIME
  963. + #if defined(NT)
  964. + #include <sys/utime.h>
  965. + #else
  966.   #include <utime.h>
  967.   #endif
  968. + #endif
  969.   #ifdef I_FCNTL
  970.   #include <fcntl.h>
  971.   #endif
  972. ***************
  973. *** 584,589 ****
  974. --- 597,610 ----
  975.           retval = (status == 0);
  976.           statusvalue = (unsigned short)status & 0xffff;
  977.       }
  978. + #if defined(NT)
  979. +         else if (stio->type == 's') {
  980. +         SOCKET s = fileno(stio->ifp);
  981. +         Safefree(stio->ifp);
  982. +         Safefree(stio->ofp);
  983. +         retval = closesocket(s) == SOCKET_ERROR ? FALSE : TRUE;
  984. +     }
  985. + #endif    
  986.       else if (stio->type == '-')
  987.           retval = TRUE;
  988.       else {
  989. ***************
  990. *** 733,739 ****
  991.   #else
  992.       retval = 256;            /* otherwise guess at what's safe */
  993.   #endif
  994. !     if (argstr->str_cur < retval) {
  995.           Str_Grow(argstr,retval+1);
  996.           argstr->str_cur = retval;
  997.       }
  998. --- 754,760 ----
  999.   #else
  1000.       retval = 256;            /* otherwise guess at what's safe */
  1001.   #endif
  1002. !     if (argstr->str_cur < (unsigned long) retval) {
  1003.           Str_Grow(argstr,retval+1);
  1004.           argstr->str_cur = retval;
  1005.       }
  1006. ***************
  1007. *** 955,962 ****
  1008. --- 976,988 ----
  1009.       else {
  1010.       int tmpfd;
  1011.   
  1012. + #if defined(NT)
  1013. +     if ((tmpfd = open(str_get(ary->ary_array[sp]), O_RDWR)) < 0)
  1014. +         result = 0;
  1015. + #else
  1016.       if ((tmpfd = open(str_get(ary->ary_array[sp]), 0)) < 0)
  1017.           result = 0;
  1018. + #endif
  1019.       else {
  1020.           if (chsize(tmpfd, len) < 0)
  1021.           result = 0;
  1022. ***************
  1023. *** 1412,1419 ****
  1024. --- 1438,1452 ----
  1025.       taintproper("Insecure dependency in socket");
  1026.   #endif
  1027.       fd = socket(domain,type,protocol);
  1028. + #if defined(NT)
  1029. +     if (fd == SOCKET_ERROR) {
  1030. +     errno = WSAGetLastError();
  1031. +     return FALSE;
  1032. +     }
  1033. + #else
  1034.       if (fd < 0)
  1035.       return FALSE;
  1036. + #endif
  1037.       stio->ifp = fdopen(fd, "r");    /* stdio gets confused about sockets */
  1038.       stio->ofp = fdopen(fd, "w");
  1039.       stio->type = 's';
  1040. ***************
  1041. *** 1435,1441 ****
  1042. --- 1468,1478 ----
  1043.       register STR **st = stack->ary_array;
  1044.       register int sp = arglast[1];
  1045.       register STIO *stio;
  1046. + #if defined(NT)
  1047. +     struct sockaddr_in *addr;
  1048. + #else
  1049.       char *addr;
  1050. + #endif
  1051.   
  1052.       if (!stab)
  1053.       goto nuts;
  1054. ***************
  1055. *** 1444,1454 ****
  1056. --- 1481,1505 ----
  1057.       if (!stio || !stio->ifp)
  1058.       goto nuts;
  1059.   
  1060. + #if defined(NT)
  1061. +     addr = (struct sockaddr_in *) str_get(st[++sp]);
  1062. + #else
  1063.       addr = str_get(st[++sp]);
  1064. + #endif
  1065.   #ifdef TAINT
  1066.       taintproper("Insecure dependency in bind");
  1067.   #endif
  1068. + #if defined(NT)
  1069. +     if (bind(fileno(stio->ifp), addr, st[sp]->str_cur) == SOCKET_ERROR) {
  1070. +     errno = WSAGetLastError();
  1071. +     return FALSE;
  1072. +     }
  1073. +     else {
  1074. +     return TRUE;
  1075. +     }
  1076. + #else
  1077.       return bind(fileno(stio->ifp), addr, st[sp]->str_cur) >= 0;
  1078. + #endif
  1079.   
  1080.   nuts:
  1081.       if (dowarn)
  1082. ***************
  1083. *** 1466,1472 ****
  1084. --- 1517,1528 ----
  1085.       register STR **st = stack->ary_array;
  1086.       register int sp = arglast[1];
  1087.       register STIO *stio;
  1088. + #if defined(NT)
  1089. +     struct sockaddr_in *addr;
  1090. + #else
  1091.       char *addr;
  1092. + #endif
  1093. +     int retval;
  1094.   
  1095.       if (!stab)
  1096.       goto nuts;
  1097. ***************
  1098. *** 1475,1485 ****
  1099. --- 1531,1555 ----
  1100.       if (!stio || !stio->ifp)
  1101.       goto nuts;
  1102.   
  1103. + #if defined(NT)
  1104. +     addr = (struct sockaddr_in *) str_get(st[++sp]);
  1105. + #else
  1106.       addr = str_get(st[++sp]);
  1107. + #endif
  1108.   #ifdef TAINT
  1109.       taintproper("Insecure dependency in connect");
  1110.   #endif
  1111. + #if defined(NT)
  1112. +     if (connect(fileno(stio->ifp), addr, st[sp]->str_cur) == SOCKET_ERROR) {
  1113. +     errno = WSAGetLastError();
  1114. +     return FALSE;
  1115. +     }
  1116. +     else {
  1117. +     return TRUE;
  1118. +     }
  1119. + #else
  1120.       return connect(fileno(stio->ifp), addr, st[sp]->str_cur) >= 0;
  1121. + #endif
  1122.   
  1123.   nuts:
  1124.       if (dowarn)
  1125. ***************
  1126. *** 1507,1513 ****
  1127. --- 1577,1593 ----
  1128.       goto nuts;
  1129.   
  1130.       backlog = (int)str_gnum(st[++sp]);
  1131. + #if defined(NT)
  1132. +     if ((listen(fileno(stio->ifp), backlog)) == SOCKET_ERROR) {
  1133. +     errno = WSAGetLastError();
  1134. +     return FALSE;
  1135. +     }
  1136. +     else {
  1137. +     return TRUE;
  1138. +     }
  1139. + #else
  1140.       return listen(fileno(stio->ifp), backlog) >= 0;
  1141. + #endif
  1142.   
  1143.   nuts:
  1144.       if (dowarn)
  1145. ***************
  1146. *** 1543,1550 ****
  1147. --- 1623,1637 ----
  1148.       do_close(nstab,FALSE);
  1149.   
  1150.       fd = accept(fileno(gstio->ifp),(struct sockaddr *)buf,&len);
  1151. + #if defined(NT)
  1152. +     if (fd == SOCKET_ERROR) {
  1153. +     errno = WSAGetLastError();
  1154. +     goto badexit;
  1155. +     }
  1156. + #else    
  1157.       if (fd < 0)
  1158.       goto badexit;
  1159. + #endif
  1160.       nstio->ifp = fdopen(fd, "r");
  1161.       nstio->ofp = fdopen(fd, "w");
  1162.       nstio->type = 's';
  1163. ***************
  1164. *** 1585,1591 ****
  1165. --- 1672,1688 ----
  1166.       goto nuts;
  1167.   
  1168.       how = (int)str_gnum(st[++sp]);
  1169. + #if defined(NT)
  1170. +     if (shutdown(fileno(stio->ifp), how)  == SOCKET_ERROR) {
  1171. +     errno = WSAGetLastError();
  1172. +     return FALSE;
  1173. +     }
  1174. +     else {
  1175. +     return TRUE;
  1176. +     }
  1177. + #else
  1178.       return shutdown(fileno(stio->ifp), how) >= 0;
  1179. + #endif
  1180.   
  1181.   nuts:
  1182.       if (dowarn)
  1183. ***************
  1184. *** 1623,1636 ****
  1185. --- 1720,1749 ----
  1186.       st[sp] = str_2mortal(Str_new(22,257));
  1187.       st[sp]->str_cur = 256;
  1188.       st[sp]->str_pok = 1;
  1189. + #if defined(NT)
  1190. +     if (getsockopt(fd, lvl, optname, st[sp]->str_ptr,
  1191. +                (int*)&st[sp]->str_cur) == SOCKET_ERROR) {
  1192. +         errno = WSAGetLastError();
  1193. +         goto nuts;
  1194. +     }
  1195. + #else
  1196.       if (getsockopt(fd, lvl, optname, st[sp]->str_ptr,
  1197.               (int*)&st[sp]->str_cur) < 0)
  1198.           goto nuts;
  1199. + #endif
  1200.       break;
  1201.       case O_SSOCKOPT:
  1202.       st[sp] = st[sp+3];
  1203. + #if defined(NT)
  1204. +     if (setsockopt(fd, lvl, optname, st[sp]->str_ptr, st[sp]->str_cur) ==
  1205. +         SOCKET_ERROR) {
  1206. +         errno = WSAGetLastError();
  1207. +         goto nuts;
  1208. +     }
  1209. + #else
  1210.       if (setsockopt(fd, lvl, optname, st[sp]->str_ptr, st[sp]->str_cur) < 0)
  1211.           goto nuts;
  1212. + #endif
  1213.       st[sp] = &str_yes;
  1214.       break;
  1215.       }
  1216. ***************
  1217. *** 1670,1681 ****
  1218. --- 1783,1810 ----
  1219.       fd = fileno(stio->ifp);
  1220.       switch (optype) {
  1221.       case O_GETSOCKNAME:
  1222. + #if defined(NT)
  1223. +     if (getsockname(fd, st[sp]->str_ptr, (int*)&st[sp]->str_cur) == 
  1224. +         SOCKET_ERROR) {
  1225. +         errno = WSAGetLastError();
  1226. +         goto nuts2;
  1227. +     }
  1228. + #else
  1229.       if (getsockname(fd, st[sp]->str_ptr, (int*)&st[sp]->str_cur) < 0)
  1230.           goto nuts2;
  1231. + #endif
  1232.       break;
  1233.       case O_GETPEERNAME:
  1234. + #if defined(NT)
  1235. +     if (getpeername(fd, st[sp]->str_ptr, (int*)&st[sp]->str_cur) ==
  1236. +         SOCKET_ERROR)  {
  1237. +         errno = WSAGetLastError();
  1238. +         goto nuts2;
  1239. +     }
  1240. + #else
  1241.       if (getpeername(fd, st[sp]->str_ptr, (int*)&st[sp]->str_cur) < 0)
  1242.           goto nuts2;
  1243. + #endif
  1244.       break;
  1245.       }
  1246.       
  1247. ***************
  1248. *** 1701,1708 ****
  1249. --- 1830,1839 ----
  1250.       register int sp = arglast[0];
  1251.       register char **elem;
  1252.       register STR *str;
  1253. + #if !defined(NT)
  1254.       struct hostent *gethostbyname();
  1255.       struct hostent *gethostbyaddr();
  1256. + #endif
  1257.   #ifdef HAS_GETHOSTENT
  1258.       struct hostent *gethostent();
  1259.   #endif
  1260. ***************
  1261. *** 1754,1760 ****
  1262. --- 1885,1895 ----
  1263.       (void)astore(ary, ++sp, str = str_mortal(&str_no));
  1264.       str_set(str, hent->h_name);
  1265.       (void)astore(ary, ++sp, str = str_mortal(&str_no));
  1266. + #if defined(NT)
  1267. +     for (elem = hent->h_aliases; elem && *elem; elem++) {
  1268. + #else
  1269.       for (elem = hent->h_aliases; *elem; elem++) {
  1270. + #endif
  1271.           str_cat(str, *elem);
  1272.           if (elem[1])
  1273.           str_ncat(str," ",1);
  1274. ***************
  1275. *** 1857,1864 ****
  1276. --- 1992,2001 ----
  1277.       register int sp = arglast[0];
  1278.       register char **elem;
  1279.       register STR *str;
  1280. + #if !defined(NT)
  1281.       struct protoent *getprotobyname();
  1282.       struct protoent *getprotobynumber();
  1283. + #endif
  1284.       struct protoent *getprotoent();
  1285.       struct protoent *pent;
  1286.   
  1287. ***************
  1288. *** 1918,1924 ****
  1289. --- 2055,2063 ----
  1290.       register int sp = arglast[0];
  1291.       register char **elem;
  1292.       register STR *str;
  1293. + #if !defined(NT)
  1294.       struct servent *getservbyname();
  1295. + #endif
  1296.       struct servent *getservbynumber();
  1297.       struct servent *getservent();
  1298.       struct servent *sent;
  1299. *** ../src-4.036/dolist.c    Tue Apr  6 15:42:24 1993
  1300. --- dolist.c    Fri May 21 09:18:54 1993
  1301. ***************
  1302. ***************
  1303. *** 1814,1820 ****
  1304.   int gimme;
  1305.   int *arglast;
  1306.   {
  1307. ! #ifdef MSDOS
  1308.       return -1;
  1309.   #else
  1310.       STR **st = stack->ary_array;
  1311. --- 1817,1823 ----
  1312.   int gimme;
  1313.   int *arglast;
  1314.   {
  1315. ! #if defined(MSDOS) || defined(NT)
  1316.       return -1;
  1317.   #else
  1318.       STR **st = stack->ary_array;
  1319. *** ../src-4.036/eval.c    Tue Apr  6 15:42:17 1993
  1320. --- eval.c    Fri May 21 09:18:59 1993
  1321. ***************
  1322. *** 117,123 ****
  1323.       double exp(), log(), sqrt(), modf();
  1324.       char *crypt(), *getenv();
  1325.       extern void grow_dlevel();
  1326.       if (!arg)
  1327.       goto say_undef;
  1328.       optype = arg->arg_type;
  1329. --- 120,128 ----
  1330.       double exp(), log(), sqrt(), modf();
  1331.       char *crypt(), *getenv();
  1332.       extern void grow_dlevel();
  1333. ! #if defined(NT)
  1334. !     extern bool NtSyncProcess;
  1335. ! #endif
  1336.       if (!arg)
  1337.       goto say_undef;
  1338.       optype = arg->arg_type;
  1339. ***************
  1340. *** 521,530 ****
  1341.               str->str_cur++;
  1342.               for (tmps = str->str_ptr; *tmps; tmps++)
  1343.               if (!isALPHA(*tmps) && !isDIGIT(*tmps) &&
  1344. !                 index("$&*(){}[]'\";\\|?<>~`",*tmps))
  1345.                   break;
  1346. !             if (*tmps && stat(str->str_ptr,&statbuf) < 0)
  1347.               goto keepgoing;        /* unmatched wildcard? */
  1348.           }
  1349.           if (gimme == G_ARRAY) {
  1350.               if (str->str_len - str->str_cur > 20) {
  1351. --- 526,537 ----
  1352.               str->str_cur++;
  1353.               for (tmps = str->str_ptr; *tmps; tmps++)
  1354.               if (!isALPHA(*tmps) && !isDIGIT(*tmps) &&
  1355. !                 index("$&*(){}[]'\";\\|?<>~`",*tmps)) 
  1356.                   break;
  1357. !             if (*tmps && stat(str->str_ptr,&statbuf) < 0) {
  1358.               goto keepgoing;        /* unmatched wildcard? */
  1359. +             }
  1360.           }
  1361.           if (gimme == G_ARRAY) {
  1362.               if (str->str_len - str->str_cur > 20) {
  1363. ***************
  1364. *** 1239,1246 ****
  1365.           lstr = (struct lstring*)str;
  1366.           str->str_magic = st[1];
  1367.           st[1]->str_rare = 's';
  1368. !         lstr->lstr_offset = tmps - str_get(st[1]); 
  1369. !         lstr->lstr_len = anum; 
  1370.           }
  1371.       }
  1372.       break;
  1373. --- 1246,1253 ----
  1374.           lstr = (struct lstring*)str;
  1375.           str->str_magic = st[1];
  1376.           st[1]->str_rare = 's';
  1377. !         lstr->lstr_offset = tmps - str_get(st[1]);
  1378. !         lstr->lstr_len = anum;
  1379.           }
  1380.       }
  1381.       break;
  1382. ***************
  1383. *** 1481,1486 ****
  1384. --- 1488,1496 ----
  1385.           str_nset(str,buf,argtype);
  1386.           }
  1387.           else
  1388. + #if defined(NT)
  1389. +         errno = WSAGetLastError();
  1390. + #endif
  1391.           str_sset(str,&str_undef);
  1392.           break;
  1393.       }
  1394. ***************
  1395. *** 1490,1495 ****
  1396. --- 1500,1512 ----
  1397.   #endif
  1398.       STR_GROW(st[2], anum+maxarg+1), (tmps = str_get(st[2]));  /* sneaky */
  1399.       if (optype == O_SYSREAD) {
  1400. + #if defined(NT)
  1401. +         if (stab_io(stab)->type == 's') {
  1402. +         warn ("NT does not support read on sockets");
  1403. +         str_sset(str, &str_undef);
  1404. +         break;
  1405. +         }
  1406. + #endif
  1407.           anum = read(fileno(stab_io(stab)->ifp), tmps+maxarg, anum);
  1408.       }
  1409.       else
  1410. ***************
  1411. *** 1498,1503 ****
  1412. --- 1515,1526 ----
  1413.           argtype = sizeof buf;
  1414.           anum = recvfrom(fileno(stab_io(stab)->ifp), tmps+maxarg, anum, 0,
  1415.           buf, &argtype);
  1416. + #if defined(NT)
  1417. +         if (anum == SOCKET_ERROR) {
  1418. +         errno = WSAGetLastError();
  1419. +         goto say_undef;
  1420. +         }
  1421. + #endif
  1422.       }
  1423.       else
  1424.   #endif
  1425. ***************
  1426. *** 1529,1534 ****
  1427. --- 1552,1563 ----
  1428.           }
  1429.       }
  1430.       else if (optype == O_SYSWRITE) {
  1431. + #if defined(NT)
  1432. +         if (stab_io(stab)->type == 's') {
  1433. +         warn("NT does not support writes to sockets");
  1434. +         break;
  1435. +         }
  1436. + #endif
  1437.           if (maxarg > 4)
  1438.           warn("Too many args on syswrite");
  1439.           if (maxarg == 4)
  1440. ***************
  1441. *** 1551,1558 ****
  1442. --- 1580,1594 ----
  1443.       else
  1444.           goto badsock;
  1445.   #endif
  1446. + #if defined(NT)
  1447. +     if (anum == SOCKET_ERROR) {
  1448. +         errno = WSAGetLastError();
  1449. +         goto say_undef;
  1450. +     }        
  1451. + #else
  1452.       if (anum < 0)
  1453.           goto say_undef;
  1454. + #endif
  1455.       value = (double)anum;
  1456.       goto donumset;
  1457.       case O_SEEK:
  1458. ***************
  1459. *** 2015,2020 ****
  1460. --- 2051,2059 ----
  1461.       }
  1462.       _exit(-1);
  1463.   #else /* ! FORK */
  1464. + #if defined(NT)
  1465. +     NtSyncProcess = TRUE;
  1466. + #endif
  1467.       if ((arg[1].arg_type & A_MASK) == A_STAB)
  1468.           value = (double)do_aspawn(st[1],arglast);
  1469.       else if (arglast[2] - arglast[1] != 1)
  1470. ***************
  1471. *** 2022,2027 ****
  1472. --- 2061,2069 ----
  1473.       else {
  1474.           value = (double)do_spawn(str_get(str_mortal(st[2])));
  1475.       }
  1476. + #if defined(NT)
  1477. +     NtSyncProcess = FALSE;
  1478. + #endif
  1479.       goto donumset;
  1480.   #endif /* FORK */
  1481.       case O_EXEC_OP:
  1482. ***************
  1483. *** 2247,2253 ****
  1484. --- 2289,2299 ----
  1485.       taintproper("Insecure dependency in mkdir");
  1486.   #endif
  1487.   #ifdef HAS_MKDIR
  1488. + #if defined(NT)
  1489. +     value = (double)(mkdir(tmps) >= 0);
  1490. + #else
  1491.       value = (double)(mkdir(tmps,anum) >= 0);
  1492. + #endif
  1493.       goto donumset;
  1494.   #else
  1495.       (void)strcpy(buf,"mkdir ");
  1496. *** ../src-4.036/perl.c    Tue Apr  6 15:42:24 1993
  1497. --- perl.c    Mon May 24 12:19:12 1993
  1498. ***************
  1499. *** 59,65 ****
  1500. --- 62,72 ----
  1501.   #include "EXTERN.h"
  1502.   #include "perl.h"
  1503.   #include "perly.h"
  1504. + #if defined(NT)
  1505. + #include "patchlvl.h"
  1506. + #else
  1507.   #include "patchlevel.h"
  1508. + #endif
  1509.   
  1510.   char *getenv();
  1511.   
  1512. ***************
  1513. *** 84,93 ****
  1514. --- 91,104 ----
  1515.   static int nrschar = '\n';      /* final char of rs, or 0777 if none */
  1516.   static int nrslen = 1;
  1517.   
  1518. + #if defined(NT)
  1519. + main(int fooargc, char **fooargv, char **env)
  1520. + #else
  1521.   main(argc,argv,env)
  1522.   register int argc;
  1523.   register char **argv;
  1524.   register char **env;
  1525. + #endif
  1526.   {
  1527.       register STR *str;
  1528.       register char *s;
  1529. ***************
  1530. *** 97,103 ****
  1531.   #ifdef DOSUID
  1532.       char *validarg = "";
  1533.   #endif
  1534.   #ifdef SETUID_SCRIPTS_ARE_SECURE_NOW
  1535.   #ifdef IAMSUID
  1536.   #undef IAMSUID
  1537. --- 108,117 ----
  1538.   #ifdef DOSUID
  1539.       char *validarg = "";
  1540.   #endif
  1541. ! #if defined(NT)
  1542. !     int argc;
  1543. !     char **argv;
  1544. ! #endif
  1545.   #ifdef SETUID_SCRIPTS_ARE_SECURE_NOW
  1546.   #ifdef IAMSUID
  1547.   #undef IAMSUID
  1548. ***************
  1549. *** 106,111 ****
  1550. --- 120,129 ----
  1551.   #endif
  1552.   #endif
  1553.   
  1554. + #if defined(NT)
  1555. +     (void) NtInitialize(&argc, &argv);
  1556. + #endif /* NT */
  1557.       origargv = argv;
  1558.       origargc = argc;
  1559.       origenviron = environ;
  1560. ***************
  1561. *** 114,119 ****
  1562. --- 132,138 ----
  1563.       gid = (int)getgid();
  1564.       egid = (int)getegid();
  1565.       sprintf(patchlevel,"%3.3s%2.2d", index(rcsid,'4'), PATCHLEVEL);
  1566.   #ifdef MSDOS
  1567.       /*
  1568.        * There is no way we can refer to them from Perl so close them to save
  1569. ***************
  1570. *** 180,186 ****
  1571.           fatal("No -e allowed in setuid scripts");
  1572.   #endif
  1573.           if (!e_fp) {
  1574. !             e_tmpname = savestr(TMPPATH);
  1575.           (void)mktemp(e_tmpname);
  1576.           if (!*e_tmpname)
  1577.               fatal("Can't mktemp()");
  1578. --- 199,223 ----
  1579.           fatal("No -e allowed in setuid scripts");
  1580.   #endif
  1581.           if (!e_fp) {
  1582. ! #if defined(NT)
  1583. !         do {
  1584. !             char tbuffer[_MAX_PATH+10];
  1585. !             int len = GetTempPath(_MAX_PATH+1, tbuffer);
  1586. !             
  1587. !             if (len) {
  1588. !             if (tbuffer[len-1] == '\\')
  1589. !                 strcat (tbuffer, "plXXXXXX");
  1590. !             else
  1591. !                 strcat(tbuffer, "\\plXXXXXX");
  1592. !             e_tmpname = savestr(tbuffer);
  1593. !             }
  1594. !             else {
  1595. !             e_tmpname = savestr(TMPPATH);
  1596. !             }
  1597. !         } while (0);
  1598. ! #else
  1599. !         e_tmpname = savestr(TMPPATH);
  1600. ! #endif
  1601.           (void)mktemp(e_tmpname);
  1602.           if (!*e_tmpname)
  1603.               fatal("Can't mktemp()");
  1604. ***************
  1605. *** 1388,1393 ****
  1606. --- 1425,1433 ----
  1607.   #ifdef atarist
  1608.           fputs("atariST series port, ++jrb  bammi@cadence.com\n", stdout);
  1609.   #endif
  1610. + #if defined(NT)
  1611. +     fputs("NT Copyright (c) 1993, Intergraph Corporation\n", stdout);
  1612. + #endif
  1613.       fputs("\n\
  1614.   Perl may be copied only under the terms of either the Artistic License or the\n\
  1615.   GNU General Public License, which may be found in the Perl 4.0 source kit.\n",stdout);
  1616. *** ../src-4.036/perl.h    Tue Apr  6 15:42:05 1993
  1617. --- perl.h    Fri May 21 09:21:02 1993
  1618. ***************
  1619. *** 63,69 ****
  1620.   #endif
  1621.   
  1622.   /* define this once if either system, instead of cluttering up the src */
  1623. ! #if defined(MSDOS) || defined(atarist)
  1624.   #define DOSISH 1
  1625.   #endif
  1626.   
  1627. --- 63,69 ----
  1628.   #endif
  1629.   
  1630.   /* define this once if either system, instead of cluttering up the src */
  1631. ! #if defined(MSDOS) || defined(atarist) || defined(NT)
  1632.   #define DOSISH 1
  1633.   #endif
  1634.   
  1635. ***************
  1636. *** 101,106 ****
  1637. --- 101,110 ----
  1638.   # define STANDARD_C 1
  1639.   #endif
  1640.   
  1641. + #if defined(NT) && !defined(STANDARD_C)
  1642. + #define STANDARD_C
  1643. + #endif
  1644.   #if defined(HASVOLATILE) || defined(STANDARD_C)
  1645.   #define VOLATILE volatile
  1646.   #else
  1647. ***************
  1648. *** 132,140 ****
  1649.   #endif
  1650.   
  1651.   #include <stdio.h>
  1652.   #include <ctype.h>
  1653.   #include <setjmp.h>
  1654. ! #ifndef MSDOS
  1655.   #ifdef PARAM_NEEDS_TYPES
  1656.   #include <sys/types.h>
  1657.   #endif
  1658. --- 136,150 ----
  1659.   #endif
  1660.   
  1661.   #include <stdio.h>
  1662. + #if defined(NT)
  1663. + #undef fdopen
  1664. + #define fdopen myfdopen
  1665. + #endif /* NT */
  1666.   #include <ctype.h>
  1667.   #include <setjmp.h>
  1668. ! #if !defined(MSDOS) && !defined(NT)
  1669.   #ifdef PARAM_NEEDS_TYPES
  1670.   #include <sys/types.h>
  1671.   #endif
  1672. ***************
  1673. *** 259,265 ****
  1674.   #   endif
  1675.   #endif
  1676.   
  1677. ! #ifndef MSDOS
  1678.   #include <sys/times.h>
  1679.   #endif
  1680.   
  1681. --- 269,275 ----
  1682.   #   endif
  1683.   #endif
  1684.   
  1685. ! #if !defined(MSDOS) && !defined(NT)
  1686.   #include <sys/times.h>
  1687.   #endif
  1688.   
  1689. ***************
  1690. *** 533,538 ****
  1691. --- 543,561 ----
  1692.   typedef struct stab STAB;
  1693.   typedef struct callsave CSV;
  1694.   
  1695. + #if defined(NT)
  1696. + /* had to wait til here to declare these guys, since STR and FILE aren\'t 
  1697. +    declared until now */
  1698. + extern int looks_like_number (STR *);
  1699. + extern FILE *mypopen (char *, char *);
  1700. + extern FILE *myfdopen(int, char *);
  1701. + extern int mypclose (FILE *);
  1702. + extern int do_aspawn (STR *, int *);
  1703. + extern int do_spawn (char *);
  1704. + extern void add_suffix (STR *, char *);
  1705. + extern int yyparse(void);
  1706. + #endif
  1707.   #include "handy.h"
  1708.   #include "regexp.h"
  1709.   #include "str.h"
  1710. ***************
  1711. *** 801,808 ****
  1712. --- 824,836 ----
  1713.   void dehoist();
  1714.   void format();
  1715.   void my_unexec();
  1716. + #if defined(NT)
  1717. + void fatal(char *, ...);
  1718. + void warn(char *, ...);
  1719. + #else
  1720.   void fatal();
  1721.   void warn();
  1722. + #endif
  1723.   #ifdef DEBUGGING
  1724.   void dump_all();
  1725.   void dump_cmd();
  1726. ***************
  1727. *** 956,962 ****
  1728.   EXT struct stat statcache;
  1729.   EXT STAB *statstab INIT(Nullstab);
  1730.   EXT STR *statname INIT(Nullstr);
  1731. ! #ifndef MSDOS
  1732.   EXT struct tms timesbuf;
  1733.   #endif
  1734.   EXT int uid;
  1735. --- 984,990 ----
  1736.   EXT struct stat statcache;
  1737.   EXT STAB *statstab INIT(Nullstab);
  1738.   EXT STR *statname INIT(Nullstr);
  1739. ! #if !defined(MSDOS) && !defined(NT)
  1740.   EXT struct tms timesbuf;
  1741.   #endif
  1742.   EXT int uid;
  1743. *** ../src-4.036/perly.h    Thu Apr 15 12:13:54 1993
  1744. --- perly.h    Fri May 21 09:21:14 1993
  1745. ***************
  1746. *** 41,46 ****
  1747. --- 41,47 ----
  1748.   #define SUB 297
  1749.   #define FILETEST 298
  1750.   #define LOCAL 299
  1751. + #undef DELETE
  1752.   #define DELETE 300
  1753.   #define RELOP 301
  1754.   #define EQOP 302
  1755. *** ../src-4.036/util.c    Tue Apr  6 15:42:20 1993
  1756. --- util.c    Fri May 21 09:23:47 1993
  1757. ***************
  1758. *** 57,62 ****
  1759. --- 57,66 ----
  1760.   #  include <varargs.h>
  1761.   #endif
  1762.   
  1763. + #ifdef I_STDARG
  1764. + #  include <stdarg.h>
  1765. + #endif
  1766.   #ifdef I_FCNTL
  1767.   #  include <fcntl.h>
  1768.   #endif
  1769. ***************
  1770. *** 857,881 ****
  1771.       }
  1772.   }
  1773.   
  1774. ! #ifndef I_VARARGS
  1775. ! /*VARARGS1*/
  1776.   char *
  1777. ! mess(pat,a1,a2,a3,a4)
  1778. ! char *pat;
  1779. ! long a1, a2, a3, a4;
  1780.   {
  1781.       char *s;
  1782. -     int usermess = strEQ(pat,"%s");
  1783.       STR *tmpstr;
  1784.   
  1785.       s = buf;
  1786.       if (usermess) {
  1787.       tmpstr = str_mortal(&str_undef);
  1788. !     str_set(tmpstr, (char*)a1);
  1789.       *s++ = tmpstr->str_ptr[tmpstr->str_cur-1];
  1790.       }
  1791.       else {
  1792. !     (void)sprintf(s,pat,a1,a2,a3,a4);
  1793.       s += strlen(s);
  1794.       }
  1795.   
  1796. --- 861,898 ----
  1797.       }
  1798.   }
  1799.   
  1800. ! #if defined(I_VARARGS)
  1801. ! /*VARARGS0*/
  1802.   char *
  1803. ! mess(args)
  1804. ! va_list args;
  1805.   {
  1806. +     char *pat;
  1807.       char *s;
  1808.       STR *tmpstr;
  1809. +     int usermess;
  1810. + #ifndef HAS_VPRINTF
  1811. + #ifdef CHARVSPRINTF
  1812. +     char *vsprintf();
  1813. + #else
  1814. +     int vsprintf();
  1815. + #endif
  1816. + #endif
  1817.   
  1818. + #ifdef lint
  1819. +     pat = Nullch;
  1820. + #else
  1821. +     pat = va_arg(args, char *);
  1822. + #endif
  1823.       s = buf;
  1824. +     usermess = strEQ(pat, "%s");
  1825.       if (usermess) {
  1826.       tmpstr = str_mortal(&str_undef);
  1827. !     str_set(tmpstr, va_arg(args, char *));
  1828.       *s++ = tmpstr->str_ptr[tmpstr->str_cur-1];
  1829.       }
  1830.       else {
  1831. !     (void) vsprintf(s,pat,args);
  1832.       s += strlen(s);
  1833.       }
  1834.   
  1835. ***************
  1836. *** 889,895 ****
  1837.           stab_io(last_in_stab) &&
  1838.           stab_io(last_in_stab)->lines ) {
  1839.           (void)sprintf(s,", <%s> line %ld",
  1840. !           last_in_stab == argvstab ? "" : stab_ename(last_in_stab),
  1841.             (long)stab_io(last_in_stab)->lines);
  1842.           s += strlen(s);
  1843.       }
  1844. --- 906,912 ----
  1845.           stab_io(last_in_stab) &&
  1846.           stab_io(last_in_stab)->lines ) {
  1847.           (void)sprintf(s,", <%s> line %ld",
  1848. !           last_in_stab == argvstab ? "" : last_in_stab->str_magic->str_ptr,
  1849.             (long)stab_io(last_in_stab)->lines);
  1850.           s += strlen(s);
  1851.       }
  1852. ***************
  1853. *** 897,919 ****
  1854.       if (usermess)
  1855.           str_cat(tmpstr,buf+1);
  1856.       }
  1857.       if (usermess)
  1858.       return tmpstr->str_ptr;
  1859.       else
  1860.       return buf;
  1861.   }
  1862.   
  1863. ! /*VARARGS1*/
  1864. ! void fatal(pat,a1,a2,a3,a4)
  1865. ! char *pat;
  1866. ! long a1, a2, a3, a4;
  1867.   {
  1868.       extern FILE *e_fp;
  1869.       extern char *e_tmpname;
  1870.       char *tmps;
  1871.       char *message;
  1872.   
  1873. !     message = mess(pat,a1,a2,a3,a4);
  1874.       if (in_eval) {
  1875.       str_set(stab_val(stabent("@",TRUE)),message);
  1876.       tmps = "_EVAL_";
  1877. --- 914,943 ----
  1878.       if (usermess)
  1879.           str_cat(tmpstr,buf+1);
  1880.       }
  1881.       if (usermess)
  1882.       return tmpstr->str_ptr;
  1883.       else
  1884.       return buf;
  1885.   }
  1886.   
  1887. ! /*VARARGS0*/
  1888. ! void fatal(va_alist)
  1889. ! va_dcl
  1890.   {
  1891. +     va_list args;
  1892.       extern FILE *e_fp;
  1893.       extern char *e_tmpname;
  1894.       char *tmps;
  1895.       char *message;
  1896.   
  1897. ! #ifndef lint
  1898. !     va_start(args);
  1899. ! #else
  1900. !     args = 0;
  1901. ! #endif
  1902. !     message = mess(args);
  1903. !     va_end(args);
  1904.       if (in_eval) {
  1905.       str_set(stab_val(stabent("@",TRUE)),message);
  1906.       tmps = "_EVAL_";
  1907. ***************
  1908. *** 947,960 ****
  1909.       exit((int)((errno&255)?errno:((statusvalue&255)?statusvalue:255)));
  1910.   }
  1911.   
  1912. ! /*VARARGS1*/
  1913. ! void warn(pat,a1,a2,a3,a4)
  1914. ! char *pat;
  1915. ! long a1, a2, a3, a4;
  1916.   {
  1917.       char *message;
  1918.   
  1919. !     message = mess(pat,a1,a2,a3,a4);
  1920.       fputs(message,stderr);
  1921.   #ifdef LEAKTEST
  1922.   #ifdef DEBUGGING
  1923. --- 971,991 ----
  1924.       exit((int)((errno&255)?errno:((statusvalue&255)?statusvalue:255)));
  1925.   }
  1926.   
  1927. ! /*VARARGS0*/
  1928. ! void warn(va_alist)
  1929. ! va_dcl
  1930.   {
  1931. +     va_list args;
  1932.       char *message;
  1933.   
  1934. ! #ifndef lint
  1935. !     va_start(args);
  1936. ! #else
  1937. !     args = 0;
  1938. ! #endif
  1939. !     message = mess(args);
  1940. !     va_end(args);
  1941.       fputs(message,stderr);
  1942.   #ifdef LEAKTEST
  1943.   #ifdef DEBUGGING
  1944. ***************
  1945. *** 964,976 ****
  1946.   #endif
  1947.       (void)fflush(stderr);
  1948.   }
  1949. ! #else
  1950. ! /*VARARGS0*/
  1951.   char *
  1952. ! mess(args)
  1953. ! va_list args;
  1954.   {
  1955. -     char *pat;
  1956.       char *s;
  1957.       STR *tmpstr;
  1958.       int usermess;
  1959. --- 995,1008 ----
  1960.   #endif
  1961.       (void)fflush(stderr);
  1962.   }
  1963. ! #elif defined(I_STDARG)
  1964. ! /* Use this for NT */
  1965.   char *
  1966. ! mess(char *pat, va_list args)
  1967.   {
  1968.       char *s;
  1969.       STR *tmpstr;
  1970.       int usermess;
  1971. ***************
  1972. *** 981,992 ****
  1973.       int vsprintf();
  1974.   #endif
  1975.   #endif
  1976. - #ifdef lint
  1977. -     pat = Nullch;
  1978. - #else
  1979. -     pat = va_arg(args, char *);
  1980. - #endif
  1981.       s = buf;
  1982.       usermess = strEQ(pat, "%s");
  1983.       if (usermess) {
  1984. --- 1013,1018 ----
  1985. ***************
  1986. *** 1025,1032 ****
  1987.   }
  1988.   
  1989.   /*VARARGS0*/
  1990. ! void fatal(va_alist)
  1991. ! va_dcl
  1992.   {
  1993.       va_list args;
  1994.       extern FILE *e_fp;
  1995. --- 1051,1057 ----
  1996.   }
  1997.   
  1998.   /*VARARGS0*/
  1999. ! void fatal(char *pat, ...)
  2000.   {
  2001.       va_list args;
  2002.       extern FILE *e_fp;
  2003. ***************
  2004. *** 1035,1045 ****
  2005.       char *message;
  2006.   
  2007.   #ifndef lint
  2008. !     va_start(args);
  2009.   #else
  2010.       args = 0;
  2011.   #endif
  2012. !     message = mess(args);
  2013.       va_end(args);
  2014.       if (in_eval) {
  2015.       str_set(stab_val(stabent("@",TRUE)),message);
  2016. --- 1060,1070 ----
  2017.       char *message;
  2018.   
  2019.   #ifndef lint
  2020. !     va_start(args, pat);
  2021.   #else
  2022.       args = 0;
  2023.   #endif
  2024. !     message = mess(pat, args);
  2025.       va_end(args);
  2026.       if (in_eval) {
  2027.       str_set(stab_val(stabent("@",TRUE)),message);
  2028. ***************
  2029. *** 1075,1092 ****
  2030.   }
  2031.   
  2032.   /*VARARGS0*/
  2033. ! void warn(va_alist)
  2034. ! va_dcl
  2035.   {
  2036.       va_list args;
  2037.       char *message;
  2038.   
  2039.   #ifndef lint
  2040. !     va_start(args);
  2041.   #else
  2042.       args = 0;
  2043.   #endif
  2044. !     message = mess(args);
  2045.       va_end(args);
  2046.   
  2047.       fputs(message,stderr);
  2048. --- 1100,1116 ----
  2049.   }
  2050.   
  2051.   /*VARARGS0*/
  2052. ! void warn(char *pat, ...)
  2053.   {
  2054.       va_list args;
  2055.       char *message;
  2056.   
  2057.   #ifndef lint
  2058. !     va_start(args, pat);
  2059.   #else
  2060.       args = 0;
  2061.   #endif
  2062. !     message = mess(pat, args);
  2063.       va_end(args);
  2064.   
  2065.       fputs(message,stderr);
  2066. ***************
  2067. *** 1098,1104 ****
  2068. --- 1122,1236 ----
  2069.   #endif
  2070.       (void)fflush(stderr);
  2071.   }
  2072. + #else
  2073. + /*VARARGS1*/
  2074. + char *
  2075. + mess(pat,a1,a2,a3,a4)
  2076. + char *pat;
  2077. + long a1, a2, a3, a4;
  2078. + {
  2079. +     char *s;
  2080. +     int usermess = strEQ(pat,"%s");
  2081. +     STR *tmpstr;
  2082. +     s = buf;
  2083. +     if (usermess) {
  2084. +     tmpstr = str_mortal(&str_undef);
  2085. +     str_set(tmpstr, (char*)a1);
  2086. +     *s++ = tmpstr->str_ptr[tmpstr->str_cur-1];
  2087. +     }
  2088. +     else {
  2089. +     (void)sprintf(s,pat,a1,a2,a3,a4);
  2090. +     s += strlen(s);
  2091. +     }
  2092. +     if (s[-1] != '\n') {
  2093. +     if (curcmd->c_line) {
  2094. +         (void)sprintf(s," at %s line %ld",
  2095. +           stab_val(curcmd->c_filestab)->str_ptr, (long)curcmd->c_line);
  2096. +         s += strlen(s);
  2097. +     }
  2098. +     if (last_in_stab &&
  2099. +         stab_io(last_in_stab) &&
  2100. +         stab_io(last_in_stab)->lines ) {
  2101. +         (void)sprintf(s,", <%s> line %ld",
  2102. +           last_in_stab == argvstab ? "" : stab_ename(last_in_stab),
  2103. +           (long)stab_io(last_in_stab)->lines);
  2104. +         s += strlen(s);
  2105. +     }
  2106. +     (void)strcpy(s,".\n");
  2107. +     if (usermess)
  2108. +         str_cat(tmpstr,buf+1);
  2109. +     }
  2110. +     if (usermess)
  2111. +     return tmpstr->str_ptr;
  2112. +     else
  2113. +     return buf;
  2114. + }
  2115. + /*VARARGS1*/
  2116. + void fatal(pat,a1,a2,a3,a4)
  2117. + char *pat;
  2118. + long a1, a2, a3, a4;
  2119. + {
  2120. +     extern FILE *e_fp;
  2121. +     extern char *e_tmpname;
  2122. +     char *tmps;
  2123. +     char *message;
  2124. +     message = mess(pat,a1,a2,a3,a4);
  2125. +     if (in_eval) {
  2126. +     str_set(stab_val(stabent("@",TRUE)),message);
  2127. +     tmps = "_EVAL_";
  2128. +     while (loop_ptr >= 0 && (!loop_stack[loop_ptr].loop_label ||
  2129. +       strNE(tmps,loop_stack[loop_ptr].loop_label) )) {
  2130. + #ifdef DEBUGGING
  2131. +         if (debug & 4) {
  2132. +         deb("(Skipping label #%d %s)\n",loop_ptr,
  2133. +             loop_stack[loop_ptr].loop_label);
  2134. +         }
  2135. + #endif
  2136. +         loop_ptr--;
  2137. +     }
  2138. + #ifdef DEBUGGING
  2139. +     if (debug & 4) {
  2140. +         deb("(Found label #%d %s)\n",loop_ptr,
  2141. +         loop_stack[loop_ptr].loop_label);
  2142. +     }
  2143. + #endif
  2144. +     if (loop_ptr < 0) {
  2145. +         in_eval = 0;
  2146. +         fatal("Bad label: %s", tmps);
  2147. +     }
  2148. +     longjmp(loop_stack[loop_ptr].loop_env, 1);
  2149. +     }
  2150. +     fputs(message,stderr);
  2151. +     (void)fflush(stderr);
  2152. +     if (e_fp)
  2153. +     (void)UNLINK(e_tmpname);
  2154. +     statusvalue >>= 8;
  2155. +     exit((int)((errno&255)?errno:((statusvalue&255)?statusvalue:255)));
  2156. + }
  2157. + /*VARARGS1*/
  2158. + void warn(pat,a1,a2,a3,a4)
  2159. + char *pat;
  2160. + long a1, a2, a3, a4;
  2161. + {
  2162. +     char *message;
  2163. +     message = mess(pat,a1,a2,a3,a4);
  2164. +     fputs(message,stderr);
  2165. + #ifdef LEAKTEST
  2166. + #ifdef DEBUGGING
  2167. +     if (debug & 4096)
  2168. +     xstat();
  2169.   #endif
  2170. + #endif
  2171. +     (void)fflush(stderr);
  2172. + }
  2173. + #endif  /* Not I_VARARGS or I_STDARG */
  2174.   
  2175.   void
  2176.   my_setenv(nam,val)
  2177.  
  2178.